#include<iostream>

using namespace std;

//二进制补码和 位运算: 与& 或|  取反~  异或^ 左移 <<  右移
int main() {
    int a = 4, b = 3;
    cout << (a & b) << endl;//bit and
    cout << (a | b) << endl;//bit or
    cout << ~a << endl;//bit not (flip)
    cout << (a << 3) << endl;//a<<k  a *2^k
    cout << (a >> 3) << endl;//a>>k   a/2^k


    for (int i = 31; i >= 0; i--)
        cout << ((a >> i) & 1);


    return 0;

}